import { ADD_PERSON } from '../constant'

// 创建 person 的核心 reducer
export default function personReducer(preState = [], action) {
  const { type, data } = action
  switch (type) {
    case ADD_PERSON:
      return [data, ...preState]

    default:
      return preState
  }
}
